<html>

<head>
    <title>010横向滑动菜单</title>
    <meta charset="utf-8">
    <style>
        a:link,
        a:visited,
        a:hover,
        a:active {
            color: #2C58E7;
            text-decoration: none;
        }

        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        #container {
            position: relative;
            z-index: 10;
            margin: 0 auto;
            top: 50%;
            transform: translateY(-50%);

            width: 800px;
            height: 500px;
            background-color: #ccc;
            border: 1px solid black;
            
            display: flex;
            justify-content: space-around;
        }

        /************** CSS ***************/
        ul{
            list-style: none;
            display: flex;
            width: 700px;
            height: 30px;
            line-height: 30px;
            border-top: 1px solid #888;
            border-bottom: 1px solid #888;
            border-right: 1px solid #888;
            padding: 0;
            overflow: hidden;
        }
        ul>li{
            position: relative;
            display: inline-block;
            height: 100%;
            flex-grow: 1;
            border-left: 1px solid #888;
            transition: margin 0.5s;
        }
        li>div{
            display: inline-block;
            height: 100%;
        }
        .label{
            position: relative;
            z-index: 2;
            width: 100%;
            text-align: center;
            background: linear-gradient(white, #39F);
        }
        li:hover{
            margin-right: 120px;
        }
        li:hover div{
            cursor: pointer;
            background: #39F;
        }
        .author{
            position: absolute;
            z-index: 0;
            left: 100%;
            top: 0;
            text-align: center;
            width: 120px;
            background: linear-gradient(white, #39F);
            color: #333333;
        }

    </style>
</head>

<body>
    <div id="container">
        <ul>
            <li>
                <div class="label"><span>CSS权威指南</span></div>
                <div class="author"><span>Eric A. Meyer</span></div>
            </li>
            <li>
                <div class="label"><span>JavaScript模式</span></div>
                <div class="author"><span>Stefanov</span></div>
            </li>
            <li>
                <div class="label"><span>JavaScript语言精粹</span></div>
                <div class="author"><span>Crockford</span></div>
            </li>
            <li>
                <div class="label"><span>ES6标准入门</span></div>
                <div class="author"><span>阮一峰</span></div>
            </li>
        </ul>
    </div>
</body>

</html>